package NGUYENTHECUONG_GIAIPHUONGTRINH;

public class MODELS {
	
	public double TinhToan(double a, double b, double c){
		double result = 0;
		double delta =(b*b)-4*a*c;
		 if(delta>0){
			 double d=Math.sqrt(delta);
			 double x1 =(-b+d)/(2*a);
			 double x2 =(-b-d)/(2*a);
			 System.out.println(" Phuong trinh co 2 nghiem :"+x1 +"va"+x2);
		 }
		 if(delta==0){
			 double x1=-b/(2*a);
			 System.out.println("Phuong trinh co 1 nghiem kep: "+x1);
		 }
		 if(delta <0){
			 System.out.println("Phuong trinh vo nghiem");
		 }
		 return result;
	}

}
